package com.zhuojy.equity.mall.admin.web.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhuojy.equity.mall.admin.common.entity.AddressBook2;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.service.AddressBookService;
import com.zhuojy.equity.mall.admin.service.AddressBookService2;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("address2")
@CrossOrigin
@RequiredArgsConstructor
@Api
public class AddressBookController2 {
    @Autowired
    private AddressBookService2 addressBookService2;
    @RequestMapping("queryAddress2")
    public ResultEntity queryAddress2(@RequestBody AddressBook2 addressBook2){
        try {
            IPage page=addressBookService2.queryAddress2(addressBook2);
            return ResultEntity.OK(page);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultEntity.OK("操作失败");
        }
    }
}
